package com.richard.home.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.module.UpFetchModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.facebook.drawee.view.SimpleDraweeView
import com.richard.base.util.ImageLoader
import com.richard.base.util.Random
import com.richard.home.R
import com.richard.home.model.bean.PoetryWord

/**
 ***************************************
 * 项目名称:Giggle
 * @Author wuzhiguo
 * 邮箱：wuzhiguo@ksjgs.com
 * 创建时间: 2020/7/23     7:27 PM
 * 用途:
 ***************************************
 */

class HomeRecPoetryAdapter :
    BaseQuickAdapter<PoetryWord, BaseViewHolder>(R.layout.home_item_rec_poetry_word),
    LoadMoreModule,
    UpFetchModule
{

    override fun convert(holder: BaseViewHolder, item: PoetryWord) {

        ImageLoader.loadImage(holder.getView(R.id.sdv_content), Random.getRandomPic())

        var poet = "--${item.poetName} ·《${item.poetryName}》"

        holder.setText(R.id.tv_content, "\"${item.content}\"")
            .setText(R.id.tv_poet, poet)
    }
}